<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'comanda-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Els camps amb <span class="required">*</span> són obligatoris.</p>

	<?php echo $form->errorSummary($model); ?>

    <?php
    /*
	<div class="row">
		<?php echo $form->labelEx($model,'data'); ?>
		<?php echo $form->textField($model,'data'); ?>
		<?php echo $form->error($model,'data'); ?>
	</div>
     * 
     */
    ?>
    
    <div class="row">
        <?php echo $form->labelEx($model,'data'); ?>
        <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'model'=>$model,
            'language'=>'ca',
            'attribute'=>'data',
            'value'=>$model->data,
            // additional javascript options for the date picker plugin
            'options'=>array(
                'showAnim'=>'fold',
                'showButtonPanel'=>true,
                'autoSize'=>true,
                'dateFormat'=>'dd/mm/yy',
                'defaultDate'=>$model->data,
                'buttonImage'=>Yii::app()->baseUrl.'/images/icons/calendari.png',
                'buttonImageOnly'=>true,
                'buttonText'=>'Triar data',
                'selectOtherMonths'=>true,
                'showOn'=>'button',
                'showOtherMonths'=>true,
                'changeMonth'=>'true',
                'changeYear'=>'true,'
            ),
        ));
        ?>
        <?php echo $form->error($model,'data'); ?>
    </div>

    <?php
    /*
	<div class="row">
		<?php echo $form->labelEx($model,'hora'); ?>
		<?php echo $form->textField($model,'hora'); ?>
		<?php echo $form->error($model,'hora'); ?>
	</div>
     * 
     */
    ?>
    
    <div class="row">
		<?php echo $form->labelEx($model,'hora'); ?>
	    <?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
            $this->widget('CJuiDateTimePicker',array(
                'model'=>$model, //Model object
                'attribute'=>'hora', //attribute name
                'mode'=>'time', //use "time","date" or "datetime" (default)
                'options'=>array(
                    'buttonImage'=>Yii::app()->baseUrl.'/images/icons/calendari.png',
                    'buttonImageOnly'=>true,
                )
            ));
        ?>
        <?php echo $form->error($model,'hora'); ?>
    </div>

    <?php
    /*
	<div class="row">
		<?php echo $form->labelEx($model,'persona_id'); ?>
		<?php echo $form->textField($model,'persona_id'); ?>
		<?php echo $form->error($model,'persona_id'); ?>
	</div>
     * 
     */
    ?>
    
    <div class="row">
		<?php echo $form->labelEx($model,'persona_id'); ?>
        <?php echo $form->dropDownList($model, 'persona_id',
            CHtml::listData(Persona::model()->findAll(), 'id', 'nom_real'),
                array('prompt'=>'(Tria un responsable)'));?>
        <?php echo $form->error($model,'persona_id'); ?>
	</div>

	<?php
    /*
    <div class="row">
		<?php echo $form->labelEx($model,'taula_id'); ?>
		<?php echo $form->textField($model,'taula_id'); ?>
		<?php echo $form->error($model,'taula_id'); ?>
	</div>
     * 
     */
    ?>
    
    <div class="row">
		<?php echo $form->labelEx($model,'taula_id'); ?>
        <?php echo $form->dropDownList($model, 'taula_id',
            CHtml::listData(Taula::model()->findAll(), 'id', 'situacio'),
                array('prompt'=>'(Tria una taula)'));?>
        <?php echo $form->error($model,'taula_id'); ?>
	</div>

    <?php
    /*
	<div class="row">
		<?php echo $form->labelEx($model,'estat_id'); ?>
		<?php echo $form->textField($model,'estat_id'); ?>
		<?php echo $form->error($model,'estat_id'); ?>
	</div>
     * 
     */
    ?>
    
    <div class="row">
		<?php echo $form->labelEx($model,'estat_id'); ?>
        <?php echo $form->dropDownList($model, 'estat_id',
            CHtml::listData(Estat::model()->findAll(), 'id', 'nom_estat'),
                array('prompt'=>'(Tria un estat)'));?>
        <?php echo $form->error($model,'estat_id'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Crear' : 'Guardar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->